package com.erp.action;

import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.Namespace;
import org.springframework.beans.factory.annotation.Autowired;

import com.erp.model.Project;
import com.erp.service.ProjectService;
import com.opensymphony.xwork2.ModelDriven;
@Namespace("/project")
@Action(value = "projectAction")
public class ProjectAction extends BaseAction implements ModelDriven<Project>
{
	private static final long serialVersionUID = 8359779018473712140L;

	private Project project;
	
	@Autowired
	private ProjectService projectService;
	
	public Project getProject()
	{
		return project;
	}

	public void setProject(Project project)
	{
		this.project = project;
	}

	@Override
	public Project getModel()
	{
		if(project==null)
		{
			project=new Project();
		}
		return project;
	}
	
	/**
	 * 查询所有项目下拉框格式
	 */
	public void findProjectListCombobox()
	{
		OutputJson(projectService.findProjectListCombobox());
	}
	
}
